<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<style>
    .order_detail{width: 100%;}
    .order_detail tbody tr{border-top: 1px dotted;}
    .order_detail tr td,.order_detail tr th{padding: 10px;;text-align: center;}
</style>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-userOrder-edit" th:object="${order}">
        <input id="orderId" name="orderId" th:field="*{orderId}"  type="hidden">
        <input type="hidden" name="status" value="1">
        <div class="form-group">
            <label class="col-sm-2 control-label">订单信息：</label>
            <div class="col-sm-3">
                <label class="control-label" th:text="*{status}" id="status"></label>
            </div>
            <div class="col-sm-4">
                <label class="control-label" th:text="*{createTime}"></label>
            </div>
            <div class="col-sm-3">
                <label class="control-label" style="color: red;" th:text="*{'总价：'+totalPrice+'元'}"></label>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <table class="order_detail">
                    <thead>
                    <tr>
                        <th width="40%">餐饮</th>
                        <th width="20%">原料</th>
                        <th width="15%">价格</th>
                        <th width="15%">数量</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="detail,indexState:${order.details}">
                        <td><img th:src="${detail.imgUrl}" style="width: 80px;height: 80px;float: left;"><span class="leave_out2" th:text="${detail.goodsName}"></span></td>
                        <td th:text="${detail.attr1}"></td>
                        <td th:text="${detail.goodsPrice}"></td>
                        <td th:text="${detail.goodsNum}"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">收货信息：</label>
            <div class="col-sm-7">
                <label class="control-label" th:text="*{receiveAddr}"></label>
            </div>
            <div class="col-sm-3">
                <label class="control-label" th:text="*{receiveUser+'(收)/'+receiveTel}"></label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">配送人信息：</label>
            <div class="col-sm-9">
                <select name="courierNumber" id="courierNumber">
                    <option value="1号骑手">1号骑手</option>
                    <option value="2号骑手">2号骑手</option>
                    <option value="3号骑手">3号骑手</option>
                    <option value="4号骑手">4号骑手</option>
                    <option value="5号骑手">5号骑手</option>
                </select>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script th:inline="javascript">
    var datas = [[${@dict.getType('sys_order_status')}]];
    $("#status").html($.table.selectDictLabel(datas, $("#status").text()));

    $("#form-userOrder-edit").validate({
        rules:{
            courierNumber:{
                required:true
            }
        }
    });
    function submitHandler() {
        if($.validate.form()){
            $.operate.save(ctx + "system/userOrder/editStatus", $('#form-userOrder-edit').serialize());
        }
    }
</script>
</body>
</html>
